package com.junyuan.gsp.util;

import org.apache.shiro.crypto.hash.SimpleHash;
import org.apache.shiro.util.ByteSource;

public class CipherUtil
{
    public static String encrypt(String account, String password)
    {
        ByteSource salt = ByteSource.Util.bytes(account);
        Object obj = new SimpleHash("MD5", password, salt, 2);
        return obj.toString();
    }

    public static void main(String[] args)
    {
        String password = CipherUtil.encrypt("admin", "1234");
        System.out.println(password);
    }
}
